import request from '@/utils/request'

// 查询设备表列表
export function listDevice(query) {
  return request({
    url: '/coal/device/list',
    method: 'get',
    params: query
  })
}

// 查询设备表详细
export function getDevice(id) {
  return request({
    url: '/coal/device/' + id,
    method: 'get'
  })
}

// 新增设备表
export function addDevice(data) {
  return request({
    url: '/coal/device',
    method: 'post',
    data: data
  })
}

// 修改设备表
export function updateDevice(data) {
  return request({
    url: '/coal/device',
    method: 'put',
    data: data
  })
}

// 删除设备表
export function delDevice(id) {
  return request({
    url: '/coal/device/' + id,
    method: 'delete'
  })
}

// 查询设备表列表
export function allListDevice(query) {
  return request({
    url: '/coal/device/allList',
    method: 'get',
    params: query
  })
}

// 查询摄像头
export function getCamera(id) {
  return request({
    url: '/coal/device/getCamera/' + id,
    method: 'get'
  })
}

export function getSieve(parentGroupId) {
  return request({
    url: '/coal/device/getSieve/' + parentGroupId,
    method: 'get'
  })
}

export function getDeviceParam(deviceId,dictValues) {
  return request({
    url: '/coal/device/getDeviceParam/' + deviceId + '/'+ dictValues,
    method: 'get'
  })
}

export function saveDeviceParam(deviceParam){
  return request({
    url: '/coal/device/saveDeviceParam',
    method: 'post',
    data: deviceParam
  })
}

// 修改设备表
export function configDensity(data) {
  return request({
    url: '/coal/device/config',
    method: 'put',
    data: data
  })
}


// 查询设备表详细
export function getDeviceByIdAndType(query) {
  return request({
    url: '/coal/device/getDevice',
    method: 'get',
    params: query
  })
}
